<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        /*
            1.大括号  量词符  里面表示重复次数
            2.中括号  字符集合  匹配中括号内的任意字符
            3.小括号  表示优先级

            在线测试： https://c.runoob.com/
        */

        //中括号  字符集合  匹配中括号内的任意字符
        var rg = /[abc]/;
        console.log(rg.test('ahkj'));
        console.log(rg.test('bhkj'));
        console.log(rg.test('hkcj'));
        var rg1 = /^[abc]/;
        console.log(rg1.test('ahkj'));
        console.log(rg1.test('bhkj'));
        console.log(rg1.test('sdchkj'));
        console.log('............................');
        var rg2 = /^[a-zA-Z]{6,16}$/;
        console.log(rg2.test('ajlviosssad'));
        console.log('.................................');

        var rg3 = /^(abc){3}$/; //让abc重复三次
        console.log(rg3.test('abc'));
        console.log(rg3.test('abcabcabc'));
        console.log(rg3.test('abcacbabc'));

    </script>
</body>
</html>